package org.goldfish.message_board01.servlets;

import jakarta.servlet.http.HttpServlet;
import org.goldfish.message_board01.services.AbstractService;

import java.util.ArrayList;
import java.util.List;

public class GFAbstractServlet extends HttpServlet {
    List<AbstractService> services;
    public GFAbstractServlet() {
        services = new ArrayList<>();
    }
    @Override
    public void destroy() {
        for (AbstractService service : services) {
            service.destroy();
        }
    }
    public void addService(AbstractService service) {
        services.add(service);
    }
}
